
#ifndef _IGJKEPASOLVER_H_
#define _IGJKEPASOLVER_H_

#include <BShape>

using namespace BWE;

struct IGjkEpaSolver
{
	struct Result
	{
		BVector pointA;
		BVector pointB;
		BVector normal;
		BReal distance;
	};

	static bool Distance(BShape* shape0, const BMatrix& wtrs0,
		BShape* shape1, const BMatrix& wtrs1,
		const BVector& guess,
		Result& results);

	static bool Penetration(BShape* shape0, const BMatrix& wtrs0,
		BShape* shape1, const BMatrix& wtrs1,
		const BVector& guess,
		Result& results);

	static BReal SignedDistance(const BVector& position,
		BReal margin,
		BShape* shape,
		const BMatrix& wtrs,
		Result& results);

	static bool SignedDistance(BShape* shape0, const BMatrix& wtrs0,
		BShape* shape1, const BMatrix& wtrs1,
		const BVector& guess,
		Result& results);
};

#endif
